import { defineStore } from "pinia";
import { ref } from "vue";
type toastType = {
    title: string;
    icon?: "success" | "loading" | "error" | "none" | "fail" | "exception";
    image?: string;
    mask?: boolean;
    duration?: number;
    position?: "top" | "center" | "bottom";
};
export const globalStore = defineStore("global", () => {
    const activeTab = ref<number>(0);
    const movePath = (path: string, back?: boolean) => {
        if (back) {
            uni.navigateBack();
            return;
        }
        uni.navigateTo({
            url: path,
        });
    };

    const showToast = (obj: toastType) => {
        uni.showToast(obj);
    };
    return { activeTab, movePath, showToast };
});
